package com.zhu.service.system.controller;

import com.zhu.model.pojo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.HashMap;

@RestController
@RequestMapping("/admin/system/index")
@Api(tags = "登录模块")
public class IndexController {
    //login
    @ApiOperation("登录")
    @PostMapping("/login")
    public Result login(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("token","admin-token");
        return Result.ok(map);
    }
    //info

    /**
     * roles: ["admin"], introduction: "I am a super administrator",…}
     * avatar
     * :
     * "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif"
     * introduction
     * :
     * "I am a super administrator"
     * name
     * :
     * "Super Admin"
     * @return
     */
    @GetMapping("info")
    @ApiOperation(value = "info")
    public Result info(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("roles","[admin]");
        map.put("introduction","I am a super administrator");
        map.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        map.put("name","Super Admin");
        return Result.ok(map);
    }
}
